Skip to content

Replace leak sanitizer with mockalloc - #19

Draft
pflanze wants to merge 5 commits into
mainfrom
cj_leak_test_mockalloc
Draft

Replace leak sanitizer with mockalloc#19
pflanze wants to merge 5 commits into
mainfrom
cj_leak_test_mockalloc

Conversation

@pflanze

@pflanze pflanze commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

This is supposed to fix #17, just like #18 is.

Sadly, I again haven't succeeded in getting this to work, either. It is probably a limitation in the overly simplicistic mockalloc crate. I have an idea how to fix that, but that's for another time, too.

The nice thing about this crate would be that it is super low overhead and super cheap to compile, as well as super tiny and thus fully understandable. (But alloc-track (mentioned in #18) might be the more interesting of those two low-profile options.)

Version from Github since the author has not released a new version.
I guess the problem is this limitation:

    Allocations are tracked separately for each thread. This allows
    tests to be run in parallel, but it means that the library will
    report false positives if a pointer returned by an allocation on
    one thread is later freed by a different thread.

Should be solvable by merging thread end states? (Needs custom TLS?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Leak checker: replace leak sanitizer with jemalloc

1 participant